package xian.woniuxy.web.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xian.woniuxy.entity.Goods;
import xian.woniuxy.service.IGoodsService;
import xian.woniuxy.util.ResultVO;

import java.util.List;

/**
 * @author zhang
 * @time 2021/12/25 13:44:12
 */
@RestController
@RequestMapping("goods")
public class GoodsController {
    @Autowired
    private IGoodsService goodsService;
    @GetMapping
    public ResultVO findAll(){
        List<Goods> goodsList = goodsService.findAll();
        return new ResultVO(200, "findAll success", goodsList);
    }
}
